\(\int \sqrt {a+b x} \sqrt {a c-b c x} \, dx\) [1147]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 68 \[ \int \sqrt {a+b x} \sqrt {a c-b c x} \, dx=\frac {1}{2} x \sqrt {a+b x} \sqrt {a c-b c x}+\frac {a^2 \sqrt {c} \arctan \left (\frac {\sqrt {c} \sqrt {a+b x}}{\sqrt {c (a-b x)}}\right )}{b} \]

[Out]

a^2*arctan(c^(1/2)*(b*x+a)^(1/2)/(c*(-b*x+a))^(1/2))*c^(1/2)/b+1/2*x*(b*x+a)^(1/2)*(-b*c*x+a*c)^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {38, 65, 223, 209} \[ \int \sqrt {a+b x} \sqrt {a c-b c x} \, dx=\frac {a^2 \sqrt {c} \arctan \left (\frac {\sqrt {c} \sqrt {a+b x}}{\sqrt {c (a-b x)}}\right )}{b}+\frac {1}{2} x \sqrt {a+b x} \sqrt {a c-b c x} \]

[In]

Int[Sqrt[a + b*x]*Sqrt[a*c - b*c*x],x]

[Out]

(x*Sqrt[a + b*x]*Sqrt[a*c - b*c*x])/2 + (a^2*Sqrt[c]*ArcTan[(Sqrt[c]*Sqrt[a + b*x])/Sqrt[c*(a - b*x)]])/b

Rule 38

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[x*(a + b*x)^m*((c + d*x)^m/(2*m + 1))
, x] + Dist[2*a*c*(m/(2*m + 1)), Int[(a + b*x)^(m - 1)*(c + d*x)^(m - 1), x], x] /; FreeQ[{a, b, c, d}, x] &&
EqQ[b*c + a*d, 0] && IGtQ[m + 1/2, 0]

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} x \sqrt {a+b x} \sqrt {a c-b c x}+\frac {1}{2} \left (a^2 c\right ) \int \frac {1}{\sqrt {a+b x} \sqrt {a c-b c x}} \, dx \\ & = \frac {1}{2} x \sqrt {a+b x} \sqrt {a c-b c x}+\frac {\left (a^2 c\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2 a c-c x^2}} \, dx,x,\sqrt {a+b x}\right )}{b} \\ & = \frac {1}{2} x \sqrt {a+b x} \sqrt {a c-b c x}+\frac {\left (a^2 c\right ) \text {Subst}\left (\int \frac {1}{1+c x^2} \, dx,x,\frac {\sqrt {a+b x}}{\sqrt {c (a-b x)}}\right )}{b} \\ & = \frac {1}{2} x \sqrt {a+b x} \sqrt {a c-b c x}+\frac {a^2 \sqrt {c} \tan ^{-1}\left (\frac {\sqrt {c} \sqrt {a+b x}}{\sqrt {c (a-b x)}}\right )}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.99 \[ \int \sqrt {a+b x} \sqrt {a c-b c x} \, dx=\frac {1}{2} \sqrt {c (a-b x)} \left (x \sqrt {a+b x}+\frac {2 a^2 \arctan \left (\frac {\sqrt {a+b x}}{\sqrt {a-b x}}\right )}{b \sqrt {a-b x}}\right ) \]

[In]

Integrate[Sqrt[a + b*x]*Sqrt[a*c - b*c*x],x]

[Out]

(Sqrt[c*(a - b*x)]*(x*Sqrt[a + b*x] + (2*a^2*ArcTan[Sqrt[a + b*x]/Sqrt[a - b*x]])/(b*Sqrt[a - b*x])))/2

Maple [A] (verified)

Time = 0.36 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.57

method result size
risch \(\frac {x \left (-b x +a \right ) \sqrt {b x +a}\, c}{2 \sqrt {-c \left (b x -a \right )}}+\frac {a^{2} \arctan \left (\frac {\sqrt {b^{2} c}\, x}{\sqrt {-b^{2} c \,x^{2}+a^{2} c}}\right ) \sqrt {-\left (b x +a \right ) c \left (b x -a \right )}\, c}{2 \sqrt {b^{2} c}\, \sqrt {b x +a}\, \sqrt {-c \left (b x -a \right )}}\) \(107\)
default \(-\frac {\sqrt {b x +a}\, \left (-b c x +a c \right )^{\frac {3}{2}}}{2 b c}+\frac {a \left (\frac {\sqrt {-b c x +a c}\, \sqrt {b x +a}}{b}+\frac {a c \sqrt {\left (b x +a \right ) \left (-b c x +a c \right )}\, \arctan \left (\frac {\sqrt {b^{2} c}\, x}{\sqrt {-b^{2} c \,x^{2}+a^{2} c}}\right )}{\sqrt {-b c x +a c}\, \sqrt {b x +a}\, \sqrt {b^{2} c}}\right )}{2}\) \(126\)

[In]

int((b*x+a)^(1/2)*(-b*c*x+a*c)^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/2*x*(-b*x+a)*(b*x+a)^(1/2)/(-c*(b*x-a))^(1/2)*c+1/2*a^2/(b^2*c)^(1/2)*arctan((b^2*c)^(1/2)*x/(-b^2*c*x^2+a^2
*c)^(1/2))*(-(b*x+a)*c*(b*x-a))^(1/2)/(b*x+a)^(1/2)/(-c*(b*x-a))^(1/2)*c

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 159, normalized size of antiderivative = 2.34 \[ \int \sqrt {a+b x} \sqrt {a c-b c x} \, dx=\left [\frac {a^{2} \sqrt {-c} \log \left (2 \, b^{2} c x^{2} + 2 \, \sqrt {-b c x + a c} \sqrt {b x + a} b \sqrt {-c} x - a^{2} c\right ) + 2 \, \sqrt {-b c x + a c} \sqrt {b x + a} b x}{4 \, b}, -\frac {a^{2} \sqrt {c} \arctan \left (\frac {\sqrt {-b c x + a c} \sqrt {b x + a} b \sqrt {c} x}{b^{2} c x^{2} - a^{2} c}\right ) - \sqrt {-b c x + a c} \sqrt {b x + a} b x}{2 \, b}\right ] \]

[In]

integrate((b*x+a)^(1/2)*(-b*c*x+a*c)^(1/2),x, algorithm="fricas")

[Out]

[1/4*(a^2*sqrt(-c)*log(2*b^2*c*x^2 + 2*sqrt(-b*c*x + a*c)*sqrt(b*x + a)*b*sqrt(-c)*x - a^2*c) + 2*sqrt(-b*c*x
+ a*c)*sqrt(b*x + a)*b*x)/b, -1/2*(a^2*sqrt(c)*arctan(sqrt(-b*c*x + a*c)*sqrt(b*x + a)*b*sqrt(c)*x/(b^2*c*x^2
- a^2*c)) - sqrt(-b*c*x + a*c)*sqrt(b*x + a)*b*x)/b]

Sympy [F]

\[ \int \sqrt {a+b x} \sqrt {a c-b c x} \, dx=\int \sqrt {- c \left (- a + b x\right )} \sqrt {a + b x}\, dx \]

[In]

integrate((b*x+a)**(1/2)*(-b*c*x+a*c)**(1/2),x)

[Out]

Integral(sqrt(-c*(-a + b*x))*sqrt(a + b*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.57 \[ \int \sqrt {a+b x} \sqrt {a c-b c x} \, dx=\frac {a^{2} \sqrt {c} \arcsin \left (\frac {b x}{a}\right )}{2 \, b} + \frac {1}{2} \, \sqrt {-b^{2} c x^{2} + a^{2} c} x \]

[In]

integrate((b*x+a)^(1/2)*(-b*c*x+a*c)^(1/2),x, algorithm="maxima")

[Out]

1/2*a^2*sqrt(c)*arcsin(b*x/a)/b + 1/2*sqrt(-b^2*c*x^2 + a^2*c)*x

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 148 vs. \(2 (56) = 112\).

Time = 0.34 (sec) , antiderivative size = 148, normalized size of antiderivative = 2.18 \[ \int \sqrt {a+b x} \sqrt {a c-b c x} \, dx=\frac {\frac {2 \, a^{2} c \log \left ({\left | -\sqrt {b x + a} \sqrt {-c} + \sqrt {-{\left (b x + a\right )} c + 2 \, a c} \right |}\right )}{\sqrt {-c}} + \sqrt {-{\left (b x + a\right )} c + 2 \, a c} \sqrt {b x + a} {\left (b x - 2 \, a\right )} - 2 \, {\left (\frac {2 \, a c \log \left ({\left | -\sqrt {b x + a} \sqrt {-c} + \sqrt {-{\left (b x + a\right )} c + 2 \, a c} \right |}\right )}{\sqrt {-c}} - \sqrt {-{\left (b x + a\right )} c + 2 \, a c} \sqrt {b x + a}\right )} a}{2 \, b} \]

[In]

integrate((b*x+a)^(1/2)*(-b*c*x+a*c)^(1/2),x, algorithm="giac")

[Out]

1/2*(2*a^2*c*log(abs(-sqrt(b*x + a)*sqrt(-c) + sqrt(-(b*x + a)*c + 2*a*c)))/sqrt(-c) + sqrt(-(b*x + a)*c + 2*a
*c)*sqrt(b*x + a)*(b*x - 2*a) - 2*(2*a*c*log(abs(-sqrt(b*x + a)*sqrt(-c) + sqrt(-(b*x + a)*c + 2*a*c)))/sqrt(-
c) - sqrt(-(b*x + a)*c + 2*a*c)*sqrt(b*x + a))*a)/b

Mupad [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.06 \[ \int \sqrt {a+b x} \sqrt {a c-b c x} \, dx=\frac {x\,\sqrt {a\,c-b\,c\,x}\,\sqrt {a+b\,x}}{2}-\frac {a^2\,\sqrt {b}\,c^2\,\ln \left (\sqrt {-b\,c}\,\sqrt {c\,\left (a-b\,x\right )}\,\sqrt {a+b\,x}-b^{3/2}\,c\,x\right )}{2\,{\left (-b\,c\right )}^{3/2}} \]

[In]

int((a*c - b*c*x)^(1/2)*(a + b*x)^(1/2),x)

[Out]

(x*(a*c - b*c*x)^(1/2)*(a + b*x)^(1/2))/2 - (a^2*b^(1/2)*c^2*log((-b*c)^(1/2)*(c*(a - b*x))^(1/2)*(a + b*x)^(1
/2) - b^(3/2)*c*x))/(2*(-b*c)^(3/2))